
_countries = [
    ('Afghanistan', 'AF', 'AFG'),
    ('Åland Islands', 'AX', 'ALA'),
    ('Albania', 'AL', 'ALB'),
    ('Algeria', 'DZ', 'DZA'),
    ('American Samoa', 'AS', 'ASM'),
    ('Andorra', 'AD', 'AND'),
    ('Angola', 'AO', 'AGO'),
    ('Anguilla', 'AI', 'AIA'),
    ('Antarctica', 'AQ', 'ATA'),
    ('Antigua and Barbuda', 'AG', 'ATG'),
    ('Argentina', 'AR', 'ARG'),
    ('Armenia', 'AM', 'ARM'),
    ('Aruba', 'AW', 'ABW'),
    ('Australia', 'AU', 'AUS'),
    ('Austria', 'AT', 'AUT'),
    ('Azerbaijan', 'AZ', 'AZE'),
    ('Bahamas', 'BS', 'BHS'),
    ('Bahrain', 'BH', 'BHR'),
    ('Bangladesh', 'BD', 'BGD'),
    ('Barbados', 'BB', 'BRB'),
    ('Belarus', 'BY', 'BLR'),
    ('Belgium', 'BE', 'BEL'),
    ('Belize', 'BZ', 'BLZ'),
    ('Benin', 'BJ', 'BEN'),
    ('Bermuda', 'BM', 'BMU'),
    ('Bhutan', 'BT', 'BTN'),
    ('Bolivia (Plurinational State of)', 'BO', 'BOL'),
    ('Bonaire, Sint Eustatius and Saba', 'BQ', 'BES'),
    ('Bosnia and Herzegovina', 'BA', 'BIH'),
    ('Botswana', 'BW', 'BWA'),
    ('Bouvet Island', 'BV', 'BVT'),
    ('Brazil', 'BR', 'BRA'),
    ('British Indian Ocean Territory', 'IO', 'IOT'),
    ('United States Minor Outlying Islands', 'UM', 'UMI'),
    ('Virgin Islands (British)', 'VG', 'VGB'),
    ('Virgin Islands (U.S.)', 'VI', 'VIR'),
    ('Brunei Darussalam', 'BN', 'BRN'),
    ('Bulgaria', 'BG', 'BGR'),
    ('Burkina Faso', 'BF', 'BFA'),
    ('Burundi', 'BI', 'BDI'),
    ('Cambodia', 'KH', 'KHM'),
    ('Cameroon', 'CM', 'CMR'),
    ('Canada', 'CA', 'CAN'),
    ('Cabo Verde', 'CV', 'CPV'),
    ('Cayman Islands', 'KY', 'CYM'),
    ('Central African Republic', 'CF', 'CAF'),
    ('Chad', 'TD', 'TCD'),
    ('Chile', 'CL', 'CHL'),
    ('China', 'CN', 'CHN'),
    ('Christmas Island', 'CX', 'CXR'),
    ('Cocos (Keeling) Islands', 'CC', 'CCK'),
    ('Colombia', 'CO', 'COL'),
    ('Comoros', 'KM', 'COM'),
    ('Congo', 'CG', 'COG'),
    ('Congo (Democratic Republic of the)', 'CD', 'COD'),
    ('Cook Islands', 'CK', 'COK'),
    ('Costa Rica', 'CR', 'CRI'),
    ('Croatia', 'HR', 'HRV'),
    ('Cuba', 'CU', 'CUB'),
    ('Curaçao', 'CW', 'CUW'),
    ('Cyprus', 'CY', 'CYP'),
    ('Czech Republic', 'CZ', 'CZE'),
    ('Denmark', 'DK', 'DNK'),
    ('Djibouti', 'DJ', 'DJI'),
    ('Dominica', 'DM', 'DMA'),
    ('Dominican Republic', 'DO', 'DOM'),
    ('Ecuador', 'EC', 'ECU'),
    ('Egypt', 'EG', 'EGY'),
    ('El Salvador', 'SV', 'SLV'),
    ('Equatorial Guinea', 'GQ', 'GNQ'),
    ('Eritrea', 'ER', 'ERI'),
    ('Estonia', 'EE', 'EST'),
    ('Ethiopia', 'ET', 'ETH'),
    ('Falkland Islands (Malvinas)', 'FK', 'FLK'),
    ('Faroe Islands', 'FO', 'FRO'),
    ('Fiji', 'FJ', 'FJI'),
    ('Finland', 'FI', 'FIN'),
    ('France', 'FR', 'FRA'),
    ('French Guiana', 'GF', 'GUF'),
    ('French Polynesia', 'PF', 'PYF'),
    ('French Southern Territories', 'TF', 'ATF'),
    ('Gabon', 'GA', 'GAB'),
    ('Gambia', 'GM', 'GMB'),
    ('Georgia', 'GE', 'GEO'),
    ('Germany', 'DE', 'DEU'),
    ('Ghana', 'GH', 'GHA'),
    ('Gibraltar', 'GI', 'GIB'),
    ('Greece', 'GR', 'GRC'),
    ('Greenland', 'GL', 'GRL'),
    ('Grenada', 'GD', 'GRD'),
    ('Guadeloupe', 'GP', 'GLP'),
    ('Guam', 'GU', 'GUM'),
    ('Guatemala', 'GT', 'GTM'),
    ('Guernsey', 'GG', 'GGY'),
    ('Guinea', 'GN', 'GIN'),
    ('Guinea-Bissau', 'GW', 'GNB'),
    ('Guyana', 'GY', 'GUY'),
    ('Haiti', 'HT', 'HTI'),
    ('Heard Island and McDonald Islands', 'HM', 'HMD'),
    ('Vatican City', 'VA', 'VAT'),
    ('Honduras', 'HN', 'HND'),
    ('Hungary', 'HU', 'HUN'),
    ('Hong Kong', 'HK', 'HKG'),
    ('Iceland', 'IS', 'ISL'),
    ('India', 'IN', 'IND'),
    ('Indonesia', 'ID', 'IDN'),
    ('Ivory Coast', 'CI', 'CIV'),
    ('Iran (Islamic Republic of)', 'IR', 'IRN'),
    ('Iraq', 'IQ', 'IRQ'),
    ('Ireland', 'IE', 'IRL'),
    ('Isle of Man', 'IM', 'IMN'),
    ('Israel', 'IL', 'ISR'),
    ('Italy', 'IT', 'ITA'),
    ('Jamaica', 'JM', 'JAM'),
    ('Japan', 'JP', 'JPN'),
    ('Jersey', 'JE', 'JEY'),
    ('Jordan', 'JO', 'JOR'),
    ('Kazakhstan', 'KZ', 'KAZ'),
    ('Kenya', 'KE', 'KEN'),
    ('Kiribati', 'KI', 'KIR'),
    ('Kuwait', 'KW', 'KWT'),
    ('Kyrgyzstan', 'KG', 'KGZ'),
    ('Lao', 'LA', 'LAO'),
    ('Latvia', 'LV', 'LVA'),
    ('Lebanon', 'LB', 'LBN'),
    ('Lesotho', 'LS', 'LSO'),
    ('Liberia', 'LR', 'LBR'),
    ('Libya', 'LY', 'LBY'),
    ('Liechtenstein', 'LI', 'LIE'),
    ('Lithuania', 'LT', 'LTU'),
    ('Luxembourg', 'LU', 'LUX'),
    ('Macao', 'MO', 'MAC'),
    ('North Macedonia', 'MK', 'MKD'),
    ('Madagascar', 'MG', 'MDG'),
    ('Malawi', 'MW', 'MWI'),
    ('Malaysia', 'MY', 'MYS'),
    ('Maldives', 'MV', 'MDV'),
    ('Mali', 'ML', 'MLI'),
    ('Malta', 'MT', 'MLT'),
    ('Marshall Islands', 'MH', 'MHL'),
    ('Martinique', 'MQ', 'MTQ'),
    ('Mauritania', 'MR', 'MRT'),
    ('Mauritius', 'MU', 'MUS'),
    ('Mayotte', 'YT', 'MYT'),
    ('Mexico', 'MX', 'MEX'),
    ('Micronesia', 'FM', 'FSM'),
    ('Moldova', 'MD', 'MDA'),
    ('Monaco', 'MC', 'MCO'),
    ('Mongolia', 'MN', 'MNG'),
    ('Montenegro', 'ME', 'MNE'),
    ('Montserrat', 'MS', 'MSR'),
    ('Morocco', 'MA', 'MAR'),
    ('Mozambique', 'MZ', 'MOZ'),
    ('Myanmar', 'MM', 'MMR'),
    ('Namibia', 'NA', 'NAM'),
    ('Nauru', 'NR', 'NRU'),
    ('Nepal', 'NP', 'NPL'),
    ('Netherlands', 'NL', 'NLD'),
    ('New Caledonia', 'NC', 'NCL'),
    ('New Zealand', 'NZ', 'NZL'),
    ('Nicaragua', 'NI', 'NIC'),
    ('Niger', 'NE', 'NER'),
    ('Nigeria', 'NG', 'NGA'),
    ('Niue', 'NU', 'NIU'),
    ('Norfolk Island', 'NF', 'NFK'),
    ('North Korea', 'KP', 'PRK'),
    ('Northern Mariana Islands', 'MP', 'MNP'),
    ('Norway', 'NO', 'NOR'),
    ('Oman', 'OM', 'OMN'),
    ('Pakistan', 'PK', 'PAK'),
    ('Palau', 'PW', 'PLW'),
    ('Palestine', 'PS', 'PSE'),
    ('Panama', 'PA', 'PAN'),
    ('Papua New Guinea', 'PG', 'PNG'),
    ('Paraguay', 'PY', 'PRY'),
    ('Peru', 'PE', 'PER'),
    ('Philippines', 'PH', 'PHL'),
    ('Pitcairn', 'PN', 'PCN'),
    ('Poland', 'PL', 'POL'),
    ('Portugal', 'PT', 'PRT'),
    ('Puerto Rico', 'PR', 'PRI'),
    ('Qatar', 'QA', 'QAT'),
    ('Republic of Kosovo', 'XK', 'UNK'),
    ('Réunion', 'RE', 'REU'),
    ('Romania', 'RO', 'ROU'),
    ('Russian Federation', 'RU', 'RUS'),
    ('Rwanda', 'RW', 'RWA'),
    ('Saint Barthélemy', 'BL', 'BLM'),
    ('Saint Helena', 'SH', 'SHN'),
    ('Saint Kitts and Nevis', 'KN', 'KNA'),
    ('Saint Lucia', 'LC', 'LCA'),
    ('Saint Martin', 'MF', 'MAF'),
    ('Saint Pierre and Miquelon', 'PM', 'SPM'),
    ('Saint Vincent and the Grenadines', 'VC', 'VCT'),
    ('Samoa', 'WS', 'WSM'),
    ('San Marino', 'SM', 'SMR'),
    ('Sao Tome and Principe', 'ST', 'STP'),
    ('Saudi Arabia', 'SA', 'SAU'),
    ('Senegal', 'SN', 'SEN'),
    ('Serbia', 'RS', 'SRB'),
    ('Seychelles', 'SC', 'SYC'),
    ('Sierra Leone', 'SL', 'SLE'),
    ('Singapore', 'SG', 'SGP'),
    ('Sint Maarten (Dutch part)', 'SX', 'SXM'),
    ('Slovakia', 'SK', 'SVK'),
    ('Slovenia', 'SI', 'SVN'),
    ('Solomon Islands', 'SB', 'SLB'),
    ('Somalia', 'SO', 'SOM'),
    ('South Africa', 'ZA', 'ZAF'),
    ('South Georgia and the South Sandwich Islands', 'GS', 'SGS'),
    ('Korea', 'KR', 'KOR'),
    ('Spain', 'ES', 'ESP'),
    ('Sri Lanka', 'LK', 'LKA'),
    ('Sudan', 'SD', 'SDN'),
    ('South Sudan', 'SS', 'SSD'),
    ('Suriname', 'SR', 'SUR'),
    ('Svalbard and Jan Mayen', 'SJ', 'SJM'),
    ('Swaziland', 'SZ', 'SWZ'),
    ('Sweden', 'SE', 'SWE'),
    ('Switzerland', 'CH', 'CHE'),
    ('Syrian Arab Republic', 'SY', 'SYR'),
    ('Taiwan', 'TW', 'TWN'),
    ('Tajikistan', 'TJ', 'TJK'),
    ('Tanzania', 'TZ', 'TZA'),
    ('Thailand', 'TH', 'THA'),
    ('Timor-Leste', 'TL', 'TLS'),
    ('Togo', 'TG', 'TGO'),
    ('Tokelau', 'TK', 'TKL'),
    ('Tonga', 'TO', 'TON'),
    ('Trinidad and Tobago', 'TT', 'TTO'),
    ('Tunisia', 'TN', 'TUN'),
    ('Turkey', 'TR', 'TUR'),
    ('Turkmenistan', 'TM', 'TKM'),
    ('Turks and Caicos Islands', 'TC', 'TCA'),
    ('Tuvalu', 'TV', 'TUV'),
    ('Uganda', 'UG', 'UGA'),
    ('Ukraine', 'UA', 'UKR'),
    ('United Arab Emirates', 'AE', 'ARE'),
    ('Great Britain', 'GB', 'GBR'),
    ('United States of America', 'US', 'USA'),
    ('Uruguay', 'UY', 'URY'),
    ('Uzbekistan', 'UZ', 'UZB'),
    ('Vanuatu', 'VU', 'VUT'),
    ('Venezuela', 'VE', 'VEN'),
    ('Vietnam', 'VN', 'VNM'),
    ('Wallis and Futuna', 'WF', 'WLF'),
    ('Western Sahara', 'EH', 'ESH'),
    ('Yemen', 'YE', 'YEM'),
    ('Zambia', 'ZM', 'ZMB'),
    ('Zimbabwe', 'ZW', 'ZWE')
]


def get_alpha3Code_from_alpha2Code(code3:str):
    for country in _countries:
        if country[1] == code3:
            return country[2]
    return None

def get_alpha2Code_from_alpha3Code(code2:str):
    for country in _countries:
        if country[2] == code2:
            return country[1]
    return None

def get_country_name_from_alpha2Code(code2:str):
    for country in _countries:
        if country[1] == code2:
            return country[0]
    return None
    
def get_country_name_from_alpha3Code(code3:str):
    for country in _countries:
        if country[2] == code3:
            return country[0]
    return None
